package com.fengycx.feign;

import com.fengycx.constants.Constants;
import com.fengycx.fallback.CreateOrderApiFallbackFactory;
import com.fengycx.param.CalculateResultParam;
import com.fengycx.param.SharedAmountDto;
import com.fengycx.param.SharedAmountResult;
import com.fengycx.result.CallDriverCalculatedBillResult;
import com.fengycx.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;


@FeignClient(value = Constants.Remote.SERVICE_RULE,contextId = "CreateOrderApi",fallbackFactory = CreateOrderApiFallbackFactory.class)
public interface CreateOrderApi {


    @PostMapping("app/CreateOrderApi")
    R<CallDriverCalculatedBillResult> getCallDriverCalculatedBillResult(@RequestBody @Valid CalculateResultParam param);

    @PostMapping("driver/rule/current")
    R<SharedAmountResult> sharedAmount(SharedAmountDto sharedAmountDto);

}
